<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

</html>

<body>
    随机：<span></span>
    <button id="btn1">停止</button>
    <script>
        var btn1 = document.querySelector('#btn1');
        var span = document.querySelector('span')
        var arr = ['泳1', '泳2', '泳3', '泳4', '泳5', '泳6', '泳7', '泳8']
        var tz = setInterval(function () {
            function sj(min, max) {
                max++;
                return Math.floor(Math.random() * (max - min) + min)
            }
            var ret = arr[sj(0, arr.length - 1)]
            span.innerHTML = ret
        }, 10)
        btn1.addEventListener("click", function () {
            clearInterval(tz);
        })

        var arr = ['12', '44', '55']
        var ret = parseInt(arr)
        console.log(ret);

    </script>

    <script src="./test.js"></script>
</body>

</html>